package com.csx.base.design.behavior.template;

/**
 * @author cuisongxu
 * @date 2022/9/26 11:59
 */
public abstract class PM {

    /**
     * 需求分析
     * @return
     */
    public abstract String analyze();

    /**
     * 软件设计
     * @param project
     * @return
     */
    public abstract String design(String project);

    /**
     * 代码开发
     * @param project
     * @return
     */
    public abstract String develop(String project);

    /**
     * 质量测试
     * @param project
     * @return
     */
    public abstract boolean test(String project);


    /**
     * 上线发布
     * @param project
     */
    public abstract void release(String project);


    protected final void kickoff() {
        String requirement = analyze();
        String designCode = design(requirement);
        do {
            designCode = develop(designCode);
            System.out.println("代码: " + designCode);
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

            // 如果测试失败则需要继续修改代码
        }while (!test(designCode));

        release(designCode);
    }
}
